import { Prop } from "@nestjs/mongoose";
import * as moment from "moment";
import { Document } from 'mongoose';
import { momentConfig } from "src/config";

export class ShareDocument extends Document {

  // 是否已删除
  @Prop({
    default: false,
  })
  isDeleted: boolean;

  // 创建日期
  @Prop({
    type: Date,
    default: Date.now,
    get: (time) => moment(time).format(momentConfig.format)
  })
  createdTime: Date;

  // 更新日期
  @Prop({
    type: Date,
    default: Date.now,
    get: (time) => moment(time).format(momentConfig.format)
  })
  updateTime: Date;
}